for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
const check = require('../')
const spy = jest.spyOn(console, 'log').mockImplementation(() => {})
jest
/** global: jest */
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.
const TIMEOUT = 3000
describe('Input helper', () => {
it('check should works', done => {
const input = 'src/test/sample.html'
const output = null
const options = {
rules: { strong: { threadhold: 2 } },
order: ['img', 'strong', 'a'],
path: 'rules'
}
check(input, output, options)
setTimeout(() => {
try {
expect(spy).toHaveBeenCalled()
expect(spy.mock.calls[0][0]).toBe(
'There are 2 <img> tag without alt attribute'
)
expect(spy.mock.calls[1][0]).toBe(
'This HTML has more than 2 <strong> tag'
expect(spy.mock.calls[2][0]).toBe(
'There are 1 <a> tag without rel attribute'
done()
} catch (err) {
done.fail(err)
}, TIMEOUT)
})
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.